----------------------------------------------------------------------------------
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output\table7.log
  log type:  text
 opened on:   3 Dec 2023, 18:17:56

. 
. version 16              

. 
. use "$data/acsmergeddata.dta", clear

. 
. ***************************************************************
. *** number of kids
. ***************************************************************
. gen numkids=min(newnumkids17,4)

. assert numkids!=.

. 
. gen all=1

. replace newnumkidswt17=round(newnumkidswt17,1)
(586 real changes made)

. bysort numkids: egen stnumkids=sum(newnumkidswt17)

. 
. gen poorkids=(poor==1)*newnumkidswt17

. bysort numkids: egen stpoorkids=sum(poorkids)

. 
. gen stillpoor=(poor==1 & poorctc21==1)*newnumkidswt17

. bysort numkids: egen ststillpoor=sum(stillpoor)

. 
. 
. gen adultsstopwork=.
(356,390 missing values generated)

. gen dynamicantipovkid=.
(356,390 missing values generated)

. 
. forvalues l=1/4{
  2. 
. * row 1
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(numkids==`l')
  3. gen group1=perwt*avgtax*.4*group
  4. egen totgroup1a=sum(group1)
  5. 
. drop group*
  6. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(numkids==`l')
  7. 
. gen group1=perwt*avgtax*.2*group
  8. egen totgroup1b=sum(group1)
  9. 
. drop group*
 10. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(numkids==`l')
 11. 
. gen group1=perwt*avgtax*.2*group
 12. egen totgroup1c=sum(group1)
 13. 
. drop group*
 14. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(numkids==`l')
 15. 
. gen group1=perwt*avgtax*.05*group
 16. egen totgroup1d=sum(group1)
 17. 
. drop group*
 18. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(numkids
> ==`l')
 19. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(numkids==`l')
 20. 
. gen group1=(perwt*person1+spouseperwt*person2)*avgtax*.05
 21. egen totgroup1e=sum(group1)
 22. 
. drop group*
 23. 
. replace adultsstopwork=totgroup1a+totgroup1b+totgroup1c+totgroup1d+totgroup1e if
>  numkids==`l'
 24. drop totgroup* person*
 25. 
. *** kids
. 
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(numkids==`l')
 26. 
. gen group4=newnumkidswt17*avgtax*.4*group*(poor==0)*poorctc21nother
 27. egen totgroup4a=sum(group4)
 28. 
. gen group5=newnumkidswt17*avgtax*.4*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 29. egen totgroup5a=sum(group5)
 30. 
. drop group*
 31. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(numkids==`l')
 32. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 33. egen totgroup4b=sum(group4)
 34. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 35. egen totgroup5b=sum(group5)
 36. 
. drop group*
 37. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(numkids==`l')
 38. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 39. egen totgroup4c=sum(group4)
 40. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 41. egen totgroup5c=sum(group5)
 42. 
. drop group*
 43. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(numkids==`l')
 44. 
. gen group4=newnumkidswt17*avgtax*.05*group*(poor==0)*poorctc21notspouse
 45. egen totgroup4d=sum(group4)
 46. 
. gen group5=newnumkidswt17*avgtax*.05*group*(poor==1)*(poorctc21==0)*poorctc21not
> spouse
 47. egen totgroup5d=sum(group5)
 48. 
. drop group*
 49. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(numkids
> ==`l')
 50. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(numkids==`l')
 51. 
. gen group4=(newnumkidswt17*person1)*avgtax*.05*(poor==0)*poorctc21nother+(newnum
> kidswt17*person2)*avgtax*.05*(poor==0)*poorctc21notspouse
 52. egen totgroup4e=sum(group4)
 53. 
. gen group5=(newnumkidswt17*person1)*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc2
> 1nother+newnumkidswt17*person2*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc21nots
> pouse
 54. egen totgroup5e=sum(group5)
 55. 
. drop group*
 56. 
. replace dynamicantipovkid=ststillpoor+totgroup4a+totgroup4b+totgroup4c+totgroup4
> d+totgroup4e+totgroup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e if numkids==
> `l'
 57. 
. drop totgroup* person*
 58. 
. }       
(160,528 real changes made)
(160,528 real changes made)
(127,990 real changes made)
(127,990 real changes made)
(47,884 real changes made)
(47,884 real changes made)
(19,988 real changes made)
(19,988 real changes made)

. 
. gen poorrate1=100*stpoorkids/stnumkids

. gen poorrate2=100*ststillpoor/stnumkids

. gen poorrate3=100*dynamicantipovkid/stnumkids

. 
. gen povreduction=(poorrate1-poorrate3)/poorrate1

. 
. table numkid [fw=newnumkidswt17], c(n all mean faminc mean stpoorkids mean ststi
> llpoor mean dynamicantipovkid ) 

--------------------------------------------------------------------------------
  numkids |       N(all)  mean(faminc)  mean(stpo~s)  mean(stst~r)  mean(dyna~d)
----------+---------------------------------------------------------------------
        1 |     1.82e+07      76889.09       2809621       2447861       2499590
        2 |     2.83e+07      89909.16       3482321       2603732       2718248
        3 |     1.62e+07      84898.63       2597712       1630480       1709350
        4 |     1.01e+07      77863.77       2287326       1045146       1084748
--------------------------------------------------------------------------------

. 
. table numkid [fw=newnumkidswt17], c(mean adultsstopwork mean poorrate1 mean poor
> rate2 mean poorrate3 mean povreduction)

--------------------------------------------------------------------------------
  numkids | mean(adul~k)  mean(poor~1)  mean(poor~2)  mean(poor~3)  mean(povr~n)
----------+---------------------------------------------------------------------
        1 |     128641.4       15.4263      13.44005      13.72406      .1103464
        2 |     129499.9       12.3149      9.207852      9.612828      .2194148
        3 |      65284.7      16.04729      10.07225      10.55947      .3419785
        4 |     31747.34      22.69768      10.37123      10.76422       .525757
--------------------------------------------------------------------------------

. 
. drop poorrate* povreduction stpoorkids ststillpoor dynamicantipovkid stnumkids s
> tpoorkids ststillpoor adultsstopwork numkid

. 
. 
. ***************************************************************
. *** married
. ***************************************************************
. 
. bysort married: egen stnumkids=sum(newnumkidswt17)

. bysort married: egen stpoorkids=sum(poorkids)

. bysort married: egen ststillpoor=sum(stillpoor)

. assert married!=.

. 
. gen adultsstopwork=.
(356,390 missing values generated)

. gen dynamicantipovkid=.
(356,390 missing values generated)

. 
. forvalues l=0/1{
  2. 
. * row 1
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(married==`l')
  3. gen group1=perwt*avgtax*.4*group
  4. egen totgroup1a=sum(group1)
  5. 
. drop group*
  6. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(married==`l')
  7. 
. gen group1=perwt*avgtax*.2*group
  8. egen totgroup1b=sum(group1)
  9. 
. drop group*
 10. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(married==`l')
 11. 
. gen group1=perwt*avgtax*.2*group
 12. egen totgroup1c=sum(group1)
 13. 
. drop group*
 14. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(married==`l')
 15. 
. gen group1=perwt*avgtax*.05*group
 16. egen totgroup1d=sum(group1)
 17. 
. drop group*
 18. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(married
> ==`l')
 19. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(married==`l')
 20. 
. gen group1=(perwt*person1+spouseperwt*person2)*avgtax*.05
 21. egen totgroup1e=sum(group1)
 22. 
. drop group*
 23. 
. replace adultsstopwork=totgroup1a+totgroup1b+totgroup1c+totgroup1d+totgroup1e if
>  married==`l'
 24. drop totgroup* person*
 25. 
. *** kids
. 
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(married==`l')
 26. 
. gen group4=newnumkidswt17*avgtax*.4*group*(poor==0)*poorctc21nother
 27. egen totgroup4a=sum(group4)
 28. 
. gen group5=newnumkidswt17*avgtax*.4*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 29. egen totgroup5a=sum(group5)
 30. 
. drop group*
 31. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(married==`l')
 32. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 33. egen totgroup4b=sum(group4)
 34. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 35. egen totgroup5b=sum(group5)
 36. 
. drop group*
 37. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(married==`l')
 38. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 39. egen totgroup4c=sum(group4)
 40. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 41. egen totgroup5c=sum(group5)
 42. 
. drop group*
 43. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(married==`l')
 44. 
. gen group4=newnumkidswt17*avgtax*.05*group*(poor==0)*poorctc21notspouse
 45. egen totgroup4d=sum(group4)
 46. 
. gen group5=newnumkidswt17*avgtax*.05*group*(poor==1)*(poorctc21==0)*poorctc21not
> spouse
 47. egen totgroup5d=sum(group5)
 48. 
. drop group*
 49. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(married
> ==`l')
 50. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(married==`l')
 51. 
. gen group4=(newnumkidswt17*person1)*avgtax*.05*(poor==0)*poorctc21nother+(newnum
> kidswt17*person2)*avgtax*.05*(poor==0)*poorctc21notspouse
 52. egen totgroup4e=sum(group4)
 53. 
. gen group5=(newnumkidswt17*person1)*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc2
> 1nother+newnumkidswt17*person2*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc21nots
> pouse
 54. egen totgroup5e=sum(group5)
 55. 
. drop group*
 56. 
. foreach var in totgroup4a totgroup4b totgroup4c totgroup4d totgroup4e totgroup5a
>  totgroup5b totgroup5c totgroup5d totgroup5e{
 57.         replace `var'=0 if `var'==.
 58. }
 59. 
. replace dynamicantipovkid=ststillpoor+totgroup4a+totgroup4b+totgroup4c+totgroup4
> d+totgroup4e+totgroup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e if married==
> `l'
 60. 
. drop totgroup* person*
 61. 
. }       
(122,494 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(122,494 real changes made)
(233,896 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(233,896 real changes made)

. 
. gen poorrate1=100*stpoorkids/stnumkids

. gen poorrate2=100*ststillpoor/stnumkids

. gen poorrate3=100*dynamicantipovkid/stnumkids

. 
. gen povreduction=(poorrate1-poorrate3)/poorrate1

. 
. table married [fw=newnumkidswt17], c(n all mean faminc mean stpoorkids mean stst
> illpoor mean dynamicantipovkid ) 

--------------------------------------------------------------------------------
  married |       N(all)  mean(faminc)  mean(stpo~s)  mean(stst~r)  mean(dyna~d)
----------+---------------------------------------------------------------------
        0 |     2.57e+07      52345.69       7403849       5096527       5340452
        1 |     4.71e+07      101052.8       3773131       2630692       2671484
--------------------------------------------------------------------------------

. 
. table married [fw=newnumkidswt17], c(mean adultsstopwork mean poorrate1 mean poo
> rrate2 mean poorrate3 mean povreduction)

--------------------------------------------------------------------------------
  married | mean(adul~k)  mean(poor~1)  mean(poor~2)  mean(poor~3)  mean(povr~n)
----------+---------------------------------------------------------------------
        0 |     290038.6      28.84043      19.85265      20.80282      .2786925
        1 |     65134.74      8.013628       5.58724      5.673877      .2919715
--------------------------------------------------------------------------------

. 
. drop poorrate* povreduction stpoorkids ststillpoor dynamicantipovkid stnumkids s
> tpoorkids ststillpoor adultsstopwork

. 
. 
. 
. ***************************************************************
. *** race
. ***************************************************************
. 
. gen raceethnic=1 if race==1 & hispanic==0
(136,388 missing values generated)

. replace raceethnic=2 if race==2 & hispanic==0
(35,009 real changes made)

. replace raceethnic=3 if race==3 & hispanic==0
(4,130 real changes made)

. replace raceethnic=4 if hispanic==1
(65,666 real changes made)

. replace raceethnic=5 if race>=4 & race<=6 & hispanic==0
(23,999 real changes made)

. replace raceethnic=6 if race>=7 & hispanic==0
(7,584 real changes made)

. assert raceethnic!=.

. tab raceethnic,m

 raceethnic |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |    220,002       61.73       61.73
          2 |     35,009        9.82       71.55
          3 |      4,130        1.16       72.71
          4 |     65,666       18.43       91.14
          5 |     23,999        6.73       97.87
          6 |      7,584        2.13      100.00
------------+-----------------------------------
      Total |    356,390      100.00

. 
. bysort raceethnic: egen stnumkids=sum(newnumkidswt17)

. bysort raceethnic: egen stpoorkids=sum(poorkids)

. bysort raceethnic: egen ststillpoor=sum(stillpoor)

. 
. gen adultsstopwork=.
(356,390 missing values generated)

. gen dynamicantipovkid=.
(356,390 missing values generated)

. 
. forvalues l=1/6{
  2. 
. * row 1
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(raceethnic==`l')
  3. gen group1=perwt*avgtax*.4*group
  4. egen totgroup1a=sum(group1)
  5. 
. drop group*
  6. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(raceethnic==`l')
  7. 
. gen group1=perwt*avgtax*.2*group
  8. egen totgroup1b=sum(group1)
  9. 
. drop group*
 10. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(raceethnic==`l')
 11. 
. gen group1=perwt*avgtax*.2*group
 12. egen totgroup1c=sum(group1)
 13. 
. drop group*
 14. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(raceethnic==`l')
 15. 
. gen group1=perwt*avgtax*.05*group
 16. egen totgroup1d=sum(group1)
 17. 
. drop group*
 18. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(raceeth
> nic==`l')
 19. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(raceethnic==`l')
 20. 
. gen group1=(perwt*person1+spouseperwt*person2)*avgtax*.05
 21. egen totgroup1e=sum(group1)
 22. 
. drop group*
 23. 
. replace adultsstopwork=totgroup1a+totgroup1b+totgroup1c+totgroup1d+totgroup1e if
>  raceethnic==`l'
 24. drop totgroup* person*
 25. 
. 
. *** kids
. 
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(raceethnic==`l')
 26. 
. gen group4=newnumkidswt17*avgtax*.4*group*(poor==0)*poorctc21nother
 27. egen totgroup4a=sum(group4)
 28. 
. gen group5=newnumkidswt17*avgtax*.4*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 29. egen totgroup5a=sum(group5)
 30. 
. drop group*
 31. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(raceethnic==`l')
 32. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 33. egen totgroup4b=sum(group4)
 34. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 35. egen totgroup5b=sum(group5)
 36. 
. drop group*
 37. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(raceethnic==`l')
 38. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 39. egen totgroup4c=sum(group4)
 40. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 41. egen totgroup5c=sum(group5)
 42. 
. drop group*
 43. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(raceethnic==`l')
 44. 
. gen group4=newnumkidswt17*avgtax*.05*group*(poor==0)*poorctc21notspouse
 45. egen totgroup4d=sum(group4)
 46. 
. gen group5=newnumkidswt17*avgtax*.05*group*(poor==1)*(poorctc21==0)*poorctc21not
> spouse
 47. egen totgroup5d=sum(group5)
 48. 
. drop group*
 49. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(raceeth
> nic==`l')
 50. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(raceethnic==`l')
 51. 
. gen group4=(newnumkidswt17*person1)*avgtax*.05*(poor==0)*poorctc21nother+(newnum
> kidswt17*person2)*avgtax*.05*(poor==0)*poorctc21notspouse
 52. egen totgroup4e=sum(group4)
 53. 
. gen group5=(newnumkidswt17*person1)*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc2
> 1nother+newnumkidswt17*person2*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc21nots
> pouse
 54. egen totgroup5e=sum(group5)
 55. 
. drop group*
 56. 
. foreach var in totgroup4a totgroup4b totgroup4c totgroup4d totgroup4e totgroup5a
>  totgroup5b totgroup5c totgroup5d totgroup5e{
 57.         replace `var'=0 if `var'==.
 58. }
 59. 
. replace dynamicantipovkid=ststillpoor+totgroup4a+totgroup4b+totgroup4c+totgroup4
> d+totgroup4e+totgroup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e if raceethni
> c==`l'
 60. 
. drop totgroup* person*
 61. }       
(220,002 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(220,002 real changes made)
(35,009 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(35,009 real changes made)
(4,130 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(4,130 real changes made)
(65,666 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(65,666 real changes made)
(23,999 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(23,999 real changes made)
(7,584 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(7,584 real changes made)

. 
. gen poorrate1=100*stpoorkids/stnumkids

. gen poorrate2=100*ststillpoor/stnumkids

. gen poorrate3=100*dynamicantipovkid/stnumkids

. 
. gen povreduction=(poorrate1-poorrate3)/poorrate1

. 
. table raceethnic [fw=newnumkidswt17], c(n all mean faminc mean stpoorkids mean s
> tstillpoor mean dynamicantipovkid ) 

--------------------------------------------------------------------------------
raceethni |
c         |       N(all)  mean(faminc)  mean(stpo~s)  mean(stst~r)  mean(dyna~d)
----------+---------------------------------------------------------------------
        1 |     3.99e+07      96048.99       3613592       2527974       2630933
        2 |      9648634      57209.63       2530624       1680793       1763878
        3 |      562,807      59580.93        143216         96025      98784.95
        4 |     1.68e+07      64095.42       4100151       2813339       2894643
        5 |      4236496      112509.3        522929        424737      432411.5
        6 |      1534046      81253.45        266468        184351      191286.6
--------------------------------------------------------------------------------

. 
. table raceethnic [fw=newnumkidswt17], c(mean adultsstopwork mean poorrate1 mean 
> poorrate2 mean poorrate3 mean povreduction)

--------------------------------------------------------------------------------
raceethni |
c         | mean(adul~k)  mean(poor~1)  mean(poor~2)  mean(poor~3)  mean(povr~n)
----------+---------------------------------------------------------------------
        1 |     146669.6      9.049032      6.330465      6.588291      .2719342
        2 |     84245.84      26.22779      17.42001      18.28111      .3029871
        3 |      3978.35      25.44673       17.0618      17.55219       .310238
        4 |     100016.3      24.34733      16.70604      17.18884      .2940155
        5 |     11531.06      12.34343      10.02567      10.20682      .1730972
        6 |     8732.161      17.37027      12.01731      12.46941      .2821406
--------------------------------------------------------------------------------

. 
. drop poorrate* povreduction stpoorkids ststillpoor dynamicantipovkid stnumkids s
> tpoorkids ststillpoor adultsstopwork raceethnic

. 
. 
. 
. 
. ***************************************************************
. *** educ
. ***************************************************************
. 
. gen ed=1 if educ<=5
(327,586 missing values generated)

. replace ed=2 if educ==6
(104,664 real changes made)

. replace ed=3 if educ==7 | educ==8
(89,280 real changes made)

. replace ed=4 if educ==10
(81,147 real changes made)

. replace ed=5 if educ==11
(52,495 real changes made)

. assert ed!=.

. tab ed,m

         ed |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     28,804        8.08        8.08
          2 |    104,664       29.37       37.45
          3 |     89,280       25.05       62.50
          4 |     81,147       22.77       85.27
          5 |     52,495       14.73      100.00
------------+-----------------------------------
      Total |    356,390      100.00

. 
. bysort ed: egen stnumkids=sum(newnumkidswt17)

. bysort ed: egen stpoorkids=sum(poorkids)

. bysort ed: egen ststillpoor=sum(stillpoor)

. 
. gen adultsstopwork=.
(356,390 missing values generated)

. gen dynamicantipovkid=.
(356,390 missing values generated)

. 
. forvalues l=1/6{
  2. 
. * row 1
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(ed==`l')
  3. gen group1=perwt*avgtax*.4*group
  4. egen totgroup1a=sum(group1)
  5. 
. drop group*
  6. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(ed==`l')
  7. 
. gen group1=perwt*avgtax*.2*group
  8. egen totgroup1b=sum(group1)
  9. 
. drop group*
 10. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(ed==`l')
 11. 
. gen group1=perwt*avgtax*.2*group
 12. egen totgroup1c=sum(group1)
 13. 
. drop group*
 14. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(ed==`l')
 15. 
. gen group1=perwt*avgtax*.05*group
 16. egen totgroup1d=sum(group1)
 17. 
. drop group*
 18. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(ed==`l'
> )
 19. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(ed==`l')
 20. 
. gen group1=(perwt*person1+spouseperwt*person2)*avgtax*.05
 21. egen totgroup1e=sum(group1)
 22. 
. drop group*
 23. 
. replace adultsstopwork=totgroup1a+totgroup1b+totgroup1c+totgroup1d+totgroup1e if
>  ed==`l'
 24. drop totgroup* person*
 25. 
. 
. *** kids
. 
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(ed==`l')
 26. 
. gen group4=newnumkidswt17*avgtax*.4*group*(poor==0)*poorctc21nother
 27. egen totgroup4a=sum(group4)
 28. 
. gen group5=newnumkidswt17*avgtax*.4*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 29. egen totgroup5a=sum(group5)
 30. 
. drop group*
 31. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(ed==`l')
 32. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 33. egen totgroup4b=sum(group4)
 34. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 35. egen totgroup5b=sum(group5)
 36. 
. drop group*
 37. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(ed==`l')
 38. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 39. egen totgroup4c=sum(group4)
 40. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 41. egen totgroup5c=sum(group5)
 42. 
. drop group*
 43. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(ed==`l')
 44. 
. gen group4=newnumkidswt17*avgtax*.05*group*(poor==0)*poorctc21notspouse
 45. egen totgroup4d=sum(group4)
 46. 
. gen group5=newnumkidswt17*avgtax*.05*group*(poor==1)*(poorctc21==0)*poorctc21not
> spouse
 47. egen totgroup5d=sum(group5)
 48. 
. drop group*
 49. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(ed==`l'
> )
 50. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(ed==`l')
 51. 
. gen group4=(newnumkidswt17*person1)*avgtax*.05*(poor==0)*poorctc21nother+(newnum
> kidswt17*person2)*avgtax*.05*(poor==0)*poorctc21notspouse
 52. egen totgroup4e=sum(group4)
 53. 
. gen group5=(newnumkidswt17*person1)*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc2
> 1nother+newnumkidswt17*person2*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc21nots
> pouse
 54. egen totgroup5e=sum(group5)
 55. 
. drop group*
 56. 
. foreach var in totgroup4a totgroup4b totgroup4c totgroup4d totgroup4e totgroup5a
>  totgroup5b totgroup5c totgroup5d totgroup5e{
 57.         replace `var'=0 if `var'==.
 58. }
 59. 
. replace dynamicantipovkid=ststillpoor+totgroup4a+totgroup4b+totgroup4c+totgroup4
> d+totgroup4e+totgroup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e if ed==`l'
 60. 
. drop totgroup* person*
 61. }       
(28,804 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(28,804 real changes made)
(104,664 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(104,664 real changes made)
(89,280 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(89,280 real changes made)
(81,147 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(81,147 real changes made)
(52,495 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(52,495 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
. gen poorrate1=100*stpoorkids/stnumkids

. gen poorrate2=100*ststillpoor/stnumkids

. gen poorrate3=100*dynamicantipovkid/stnumkids

. 
. gen povreduction=(poorrate1-poorrate3)/poorrate1

. 
. table ed [fw=newnumkidswt17], c(n all mean faminc mean stpoorkids mean ststillpo
> or mean dynamicantipovkid ) 

--------------------------------------------------------------------------------
       ed |       N(all)  mean(faminc)  mean(stpo~s)  mean(stst~r)  mean(dyna~d)
----------+---------------------------------------------------------------------
        1 |      7794302      49248.24       2831563       1871301       1902767
        2 |     2.17e+07      60836.75       4733993       3244376       3359069
        3 |     1.86e+07      71869.51       2570291       1784938       1880704
        4 |     1.53e+07      113108.7        770153        601245      632006.6
        5 |      9353472      142117.8        270980        225359      237389.9
--------------------------------------------------------------------------------

. 
. table ed [fw=newnumkidswt17], c(mean adultsstopwork mean poorrate1 mean poorrate
> 2 mean poorrate3 mean povreduction)

--------------------------------------------------------------------------------
       ed | mean(adul~k)  mean(poor~1)  mean(poor~2)  mean(poor~3)  mean(povr~n)
----------+---------------------------------------------------------------------
        1 |     41217.27      36.32863      24.00858      24.41228      .3280152
        2 |     147274.4      21.85889      14.98069      15.51027      .2904365
        3 |     116754.7      13.78258       9.57131      10.08483      .2682915
        4 |     37175.02      5.033012      3.929185      4.130215      .1793752
        5 |     12751.91      2.897106      2.409362      2.537987      .1239578
--------------------------------------------------------------------------------

. 
. drop poorrate* povreduction stpoorkids ststillpoor dynamicantipovkid stnumkids s
> tpoorkids ststillpoor adultsstopwork ed

. 
. 
. 
. 
. ***************************************************************
. *** urban/rural
. ***************************************************************
. 
. gen urbanrural=1 if metro==1
(321,402 missing values generated)

. replace urbanrural=2 if metro==0
(55,645 real changes made)

. replace urbanrural=3 if metro==3
(91,611 real changes made)

. replace urbanrural=4 if metro==4
(141,963 real changes made)

. replace urbanrural=5 if metro==2
(32,183 real changes made)

. assert urbanrural!=.

. 
. tab urbanrural,m

 urbanrural |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     34,988        9.82        9.82
          2 |     55,645       15.61       25.43
          3 |     91,611       25.71       51.14
          4 |    141,963       39.83       90.97
          5 |     32,183        9.03      100.00
------------+-----------------------------------
      Total |    356,390      100.00

. 
. bysort urbanrural: egen stnumkids=sum(newnumkidswt17)

. bysort urbanrural: egen stpoorkids=sum(poorkids)

. bysort urbanrural: egen ststillpoor=sum(stillpoor)

. 
. gen adultsstopwork=.
(356,390 missing values generated)

. gen dynamicantipovkid=.
(356,390 missing values generated)

. 
. forvalues l=1/6{
  2. 
. * row 1
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(urbanrural==`l')
  3. gen group1=perwt*avgtax*.4*group
  4. egen totgroup1a=sum(group1)
  5. 
. drop group*
  6. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(urbanrural==`l')
  7. 
. gen group1=perwt*avgtax*.2*group
  8. egen totgroup1b=sum(group1)
  9. 
. drop group*
 10. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(urbanrural==`l')
 11. 
. gen group1=perwt*avgtax*.2*group
 12. egen totgroup1c=sum(group1)
 13. 
. drop group*
 14. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(urbanrural==`l')
 15. 
. gen group1=perwt*avgtax*.05*group
 16. egen totgroup1d=sum(group1)
 17. 
. drop group*
 18. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(urbanru
> ral==`l')
 19. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(urbanrural==`l')
 20. 
. gen group1=(perwt*person1+spouseperwt*person2)*avgtax*.05
 21. egen totgroup1e=sum(group1)
 22. 
. drop group*
 23. 
. replace adultsstopwork=totgroup1a+totgroup1b+totgroup1c+totgroup1d+totgroup1e if
>  urbanrural==`l'
 24. drop totgroup* person*
 25. 
. 
. *** kids
. 
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(urbanrural==`l')
 26. 
. gen group4=newnumkidswt17*avgtax*.4*group*(poor==0)*poorctc21nother
 27. egen totgroup4a=sum(group4)
 28. 
. gen group5=newnumkidswt17*avgtax*.4*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 29. egen totgroup5a=sum(group5)
 30. 
. drop group*
 31. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(urbanrural==`l')
 32. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 33. egen totgroup4b=sum(group4)
 34. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 35. egen totgroup5b=sum(group5)
 36. 
. drop group*
 37. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(urbanrural==`l')
 38. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 39. egen totgroup4c=sum(group4)
 40. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 41. egen totgroup5c=sum(group5)
 42. 
. drop group*
 43. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(urbanrural==`l')
 44. 
. gen group4=newnumkidswt17*avgtax*.05*group*(poor==0)*poorctc21notspouse
 45. egen totgroup4d=sum(group4)
 46. 
. gen group5=newnumkidswt17*avgtax*.05*group*(poor==1)*(poorctc21==0)*poorctc21not
> spouse
 47. egen totgroup5d=sum(group5)
 48. 
. drop group*
 49. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(urbanru
> ral==`l')
 50. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(urbanrural==`l')
 51. 
. gen group4=(newnumkidswt17*person1)*avgtax*.05*(poor==0)*poorctc21nother+(newnum
> kidswt17*person2)*avgtax*.05*(poor==0)*poorctc21notspouse
 52. egen totgroup4e=sum(group4)
 53. 
. gen group5=(newnumkidswt17*person1)*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc2
> 1nother+newnumkidswt17*person2*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc21nots
> pouse
 54. egen totgroup5e=sum(group5)
 55. 
. drop group*
 56. 
. foreach var in totgroup4a totgroup4b totgroup4c totgroup4d totgroup4e totgroup5a
>  totgroup5b totgroup5c totgroup5d totgroup5e{
 57.         replace `var'=0 if `var'==.
 58. }
 59. 
. replace dynamicantipovkid=ststillpoor+totgroup4a+totgroup4b+totgroup4c+totgroup4
> d+totgroup4e+totgroup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e if urbanrura
> l==`l'
 60. 
. drop totgroup* person*
 61. }       
(34,988 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(34,988 real changes made)
(55,645 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(55,645 real changes made)
(91,611 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(91,611 real changes made)
(141,963 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(141,963 real changes made)
(32,183 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(32,183 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
. gen poorrate1=100*stpoorkids/stnumkids

. gen poorrate2=100*ststillpoor/stnumkids

. gen poorrate3=100*dynamicantipovkid/stnumkids

. 
. gen povreduction=(poorrate1-poorrate3)/poorrate1

. 
. table urbanrural [fw=newnumkidswt17], c(n all mean faminc mean stpoorkids mean s
> tstillpoor mean dynamicantipovkid ) 

--------------------------------------------------------------------------------
urbanrura |
l         |       N(all)  mean(faminc)  mean(stpo~s)  mean(stst~r)  mean(dyna~d)
----------+---------------------------------------------------------------------
        1 |      5682670      65260.64        811453        489806      512040.4
        2 |      9506142      70789.15       1272601        828545      864064.9
        3 |     1.90e+07      97786.65       2370537       1724161       1783210
        4 |     3.13e+07      84290.08       4802594       3282793       3411906
        5 |      7270515      77288.71       1919795       1401914       1440715
--------------------------------------------------------------------------------

. 
. table urbanrural [fw=newnumkidswt17], c(mean adultsstopwork mean poorrate1 mean 
> poorrate2 mean poorrate3 mean povreduction)

--------------------------------------------------------------------------------
urbanrura |
l         | mean(adul~k)  mean(poor~1)  mean(poor~2)  mean(poor~3)  mean(povr~n)
----------+---------------------------------------------------------------------
        1 |     31041.37      14.27943      8.619293      9.010561      .3689832
        2 |     49544.59      13.38715      8.715891      9.089543      .3210245
        3 |     78385.76      12.46988      9.069709      9.380324      .2477614
        4 |       153792      15.35049      10.49276      10.90545      .2895701
        5 |     42409.62      26.40521      19.28218      19.81586      .2495474
--------------------------------------------------------------------------------

. 
. drop poorrate* povreduction stpoorkids ststillpoor dynamicantipovkid stnumkids s
> tpoorkids ststillpoor adultsstopwork            

. 
. 
. ***************************************************************
. *** renters/home owners
. ***************************************************************
. 
. gen rentvsown=1 if mortgage==0
(240,789 missing values generated)

. replace rentvsown=2 if mortgage==3 | mortgage==4 | mortgage==1
(240,789 real changes made)

. *replace rentvsown=3 if mortgage==1
. 
. assert rentvsown!=.

. 
. tab rentvsown,m

  rentvsown |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |    115,601       32.44       32.44
          2 |    240,789       67.56      100.00
------------+-----------------------------------
      Total |    356,390      100.00

. 
. bysort rentvsown: egen stnumkids=sum(newnumkidswt17)

. bysort rentvsown: egen stpoorkids=sum(poorkids)

. bysort rentvsown: egen ststillpoor=sum(stillpoor)

. 
. gen adultsstopwork=.
(356,390 missing values generated)

. gen dynamicantipovkid=.
(356,390 missing values generated)

. 
. forvalues l=1/2{
  2. 
. * row 1
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(rentvsown==`l')
  3. gen group1=perwt*avgtax*.4*group
  4. egen totgroup1a=sum(group1)
  5. 
. drop group*
  6. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(rentvsown==`l')
  7. 
. gen group1=perwt*avgtax*.2*group
  8. egen totgroup1b=sum(group1)
  9. 
. drop group*
 10. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(rentvsown==`l')
 11. 
. gen group1=perwt*avgtax*.2*group
 12. egen totgroup1c=sum(group1)
 13. 
. drop group*
 14. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(rentvsown==`l')
 15. 
. gen group1=perwt*avgtax*.05*group
 16. egen totgroup1d=sum(group1)
 17. 
. drop group*
 18. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(rentvso
> wn==`l')
 19. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(rentvsown==`l')
 20. 
. gen group1=(perwt*person1+spouseperwt*person2)*avgtax*.05
 21. egen totgroup1e=sum(group1)
 22. 
. drop group*
 23. 
. replace adultsstopwork=totgroup1a+totgroup1b+totgroup1c+totgroup1d+totgroup1e if
>  rentvsown==`l'
 24. drop totgroup* person*
 25. 
. 
. *** kids
. 
. gen group=(married==0)*(incwage>0)*(v25>0)*(agi2017<80000)*(calckids>0)*(samplej
> ustwomen==1)*(rentvsown==`l')
 26. 
. gen group4=newnumkidswt17*avgtax*.4*group*(poor==0)*poorctc21nother
 27. egen totgroup4a=sum(group4)
 28. 
. gen group5=newnumkidswt17*avgtax*.4*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 29. egen totgroup5a=sum(group5)
 30. 
. drop group*
 31. 
. * row 2
. gen group=(married==0)*(incwage>0)*(v25==0)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(rentvsown==`l')
 32. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 33. egen totgroup4b=sum(group4)
 34. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 35. egen totgroup5b=sum(group5)
 36. 
. drop group*
 37. 
. * row 3
. gen group=(married==1)*(incwage>0)*(agi2017<80000)*(calckids>0)*(samplejustwomen
> ==1)*(rentvsown==`l')
 38. 
. gen group4=newnumkidswt17*avgtax*.2*group*(poor==0)*poorctc21nother
 39. egen totgroup4c=sum(group4)
 40. 
. gen group5=newnumkidswt17*avgtax*.2*group*(poor==1)*(poorctc21==0)*poorctc21noth
> er
 41. egen totgroup5c=sum(group5)
 42. 
. drop group*
 43. 
. * row 4
. gen group=(married==1)*(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(sample
> justwomen==1)*(rentvsown==`l')
 44. 
. gen group4=newnumkidswt17*avgtax*.05*group*(poor==0)*poorctc21notspouse
 45. egen totgroup4d=sum(group4)
 46. 
. gen group5=newnumkidswt17*avgtax*.05*group*(poor==1)*(poorctc21==0)*poorctc21not
> spouse
 47. egen totgroup5d=sum(group5)
 48. 
. drop group*
 49. 
. 
. * row 5: sum up non-mom and potential spouse
. gen person1=(incwage>0)*(agi2017<80000)*(calckids>0)*(samplenotmoms==1)*(rentvso
> wn==`l')
 50. gen person2=(totincwage>incwage)*(agi2017<80000)*(calckids>0)*(samplenotmoms=
> =1)*(married==1)*(rentvsown==`l')
 51. 
. gen group4=(newnumkidswt17*person1)*avgtax*.05*(poor==0)*poorctc21nother+(newnum
> kidswt17*person2)*avgtax*.05*(poor==0)*poorctc21notspouse
 52. egen totgroup4e=sum(group4)
 53. 
. gen group5=(newnumkidswt17*person1)*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc2
> 1nother+newnumkidswt17*person2*avgtax*.05*(poor==1)*(poorctc21==0)*poorctc21nots
> pouse
 54. egen totgroup5e=sum(group5)
 55. 
. drop group*
 56. 
. foreach var in totgroup4a totgroup4b totgroup4c totgroup4d totgroup4e totgroup5a
>  totgroup5b totgroup5c totgroup5d totgroup5e{
 57.         replace `var'=0 if `var'==.
 58. }
 59. 
. replace dynamicantipovkid=ststillpoor+totgroup4a+totgroup4b+totgroup4c+totgroup4
> d+totgroup4e+totgroup5a+totgroup5b+totgroup5c+totgroup5d+totgroup5e if rentvsown
> ==`l'
 60. 
. drop totgroup* person*
 61. }       
(115,601 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(115,601 real changes made)
(240,789 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(240,789 real changes made)

. 
. gen poorrate1=100*stpoorkids/stnumkids

. gen poorrate2=100*ststillpoor/stnumkids

. gen poorrate3=100*dynamicantipovkid/stnumkids

. 
. gen povreduction=(poorrate1-poorrate3)/poorrate1

. 
. table rentvsown [fw=newnumkidswt17], c(n all mean faminc mean stpoorkids mean st
> stillpoor mean dynamicantipovkid ) 

--------------------------------------------------------------------------------
rentvsown |       N(all)  mean(faminc)  mean(stpo~s)  mean(stst~r)  mean(dyna~d)
----------+---------------------------------------------------------------------
        1 |     2.85e+07      53375.25       8036983       5467978       5666127
        2 |     4.43e+07      103457.8       3139997       2259241       2345809
--------------------------------------------------------------------------------

. 
. table rentvsown [fw=newnumkidswt17], c(mean adultsstopwork mean poorrate1 mean p
> oorrate2 mean poorrate3 mean povreduction)

--------------------------------------------------------------------------------
rentvsown | mean(adul~k)  mean(poor~1)  mean(poor~2)  mean(poor~3)  mean(povr~n)
----------+---------------------------------------------------------------------
        1 |     212062.1      28.23911      19.21253      19.90876      .2949933
        2 |     143111.2      7.088794      5.100417      5.295851      .2529263
--------------------------------------------------------------------------------

. 
. drop poorrate* povreduction stpoorkids ststillpoor dynamicantipovkid stnumkids s
> tpoorkids ststillpoor adultsstopwork            

. 
. log close
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output\table7.log
  log type:  text
 closed on:   3 Dec 2023, 18:18:31
----------------------------------------------------------------------------------
